#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>

double sigmoid(double x){
    return  (1 / (1 + exp(-x)));
}
double tanh(double x){
    return ((exp(x)-exp(-x)) / (exp(x)+exp(-x)));
}

int main(void){

    srand((unsigned int)time(NULL));
    double x = (double)(rand() % 200) / 100 - 1.0;
    double y1 = sigmoid(x);
    double y2 = tanh(x);
    printf("sigmoid of %f is: %f. \n", x, y1);
    printf("tanh of %f is: %f. \n", x, y2);
    return 0;
}